package com.zzy.demo.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zzy.cms.core.base.service.BaseServiceImpl;
import com.zzy.demo.common.constant.QiniuConst;
import com.zzy.demo.dao.MusicDao;
import com.zzy.demo.model.Music;


@Service
public class MusicService extends BaseServiceImpl<MusicDao, Music, String>{
	
	@Autowired
	MusicDao musicDao;
	
	
	public void updateField() {
		List<Music> list = musicDao.findAll();
		for(Music music : list) {
			String url = music.getUrl();
			String filekey = url.replace(QiniuConst.QN_BASE_DOMAIN, "");
			music.setId(music.getId());
			music.setFileKey(filekey);
			musicDao.save(music);
		}
		
	}



}
